﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="TrainingWorkshop.UserList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body style="height: 170px; width: 882px;">
    <form id="UserListform" runat="server">
    <div style="font-size: larger">
    
        User List</div>
    <br/>
    
    <asp:Panel ID="SearchUserPanel" runat="server" Height="102px" 
        GroupingText="Search User" Width="883px">
    <br />
        &nbsp;&nbsp;&nbsp;
        <asp:Label ID="UserNameLabel" runat="server" Text="User Name"></asp:Label>

        &nbsp;<asp:TextBox ID="UserNameTextBox" runat="server" Width="186px" 
            Height="22px"></asp:TextBox>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="DepartmentLabel" runat="server" Text="Department"></asp:Label>
        &nbsp;&nbsp;
        <asp:DropDownList ID="DepartmentDropDownList" runat="server" Height="25px" 
            Width="197px" AppendDataBoundItems="True">
        </asp:DropDownList>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button 
            ID="SearchButton" runat="server" Text="Search" 
            Width="139px" Height="24px" onclick="SearchButton_Click" />
        <br />
        <br />
    </asp:Panel>
    <asp:Panel ID="UserListPanel" runat="server" Height="322px" 
        GroupingText="User List" Width="888px">
    <br />
        <asp:Button ID="CreateNewUserButton" runat="server" Text="Create New User" 
            Width="140px" Height="24px" style="margin-left: 19px" 
            onclick="CreateNewUserButton_Click" />
        <br />
        <br />
        <br />
        <asp:GridView ID="UserListGridView" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None" Width="726px" 
            onrowdeleting="UserListGridView_RowDeleting" 
            onrowdatabound="UserListGridView_RowDataBound" 
            onrowediting="UserListGridView_RowEditing"   >
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="UserId">
                    <EditItemTemplate>
                         <asp:Label ID="UserIdLabel" runat="server" Text='<%# Bind("UserId") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="UserIdLabel" runat="server" Text='<%# Bind("UserId") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="FirstName">
                    <EditItemTemplate>
                        <asp:TextBox ID="FirstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="LastName">
                    <EditItemTemplate>
                        <asp:TextBox ID="LastNameTextBox" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LastNameLabel" runat="server" Text='<%# Bind("LastName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="DepartmentName">
                    <EditItemTemplate>
                        <asp:TextBox ID="DepartmentIdTextBox" runat="server" Text='<%# Bind("departmentId.DepartmentName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="DepartmentIdLabel" runat="server" Text='<%# Bind("departmentId.DepartmentName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="RoleName">
                    <EditItemTemplate>
                        <asp:TextBox ID="RoleIdTextBox" runat="server" Text='<%# Bind("roleId.RoleName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="RoleIdLabel" runat="server" Text='<%# Bind("roleId.RoleName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Management" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="EditLinkButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="EditLinkButton" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <br />
    </asp:Panel>
    </form>
</body>
</html>
